<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String ctx = request.getContextPath();
    request.setAttribute("ctx", ctx);
%>
<html>
<head>
    <script src="js/jquery-1.8.2.min.js"></script>
</head>
<body>
<form action="login.do" method="post">
    账号: <input type="text" name="uname" id="uname"> <br>
    密码: <input type="text" name="upwd" id="upwd"> <br>
    <input type="submit" value="登录" id="lo">
</form>
</body>
<script>
    $("#lo").click(function () {

        if ($("#uname").val()==0){
            alert("用户名不能为空");
        }
            let val = $("#upwd").val();
            if(val==0){
                alert("密码不能为空")
            }
    })

</script>
</html>
